"Around half a dozen people are still buried under the debris," said police spokesman Ghulam Abbas. Of the injured, 11 are in serious condition, he added.
The incident occurred late on Wednesday in Kanpur, 80km south-west of the Uttar Pradesh state capital Lucknow.
About 35 families occupied the 36-room building. "Most of the families were workers from leather tanneries," Abbas said.
The blast was probably triggered by a leak in a cooking gas cylinder, Abbas said.
Most of the casualties were women and children as male members of the families had gone to a nearby mosque when the blast took place, said Vijay Shankar Singh, chief medical officer of the Kanpur hospital.